package utils;

import java.io.File;
import java.io.FileInputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class IniFilesReader {
	public static Map<String, String> readIniFile(String filePath) throws Exception
	{
		Map<String, String> propertiesMap = new HashMap<String, String>();
		File file = new File(filePath);
		FileInputStream inStream = new FileInputStream(file);
		Properties properties = new Properties();
		properties.load(inStream);
		
		Enumeration<?> enumerationSet = properties.propertyNames();
		
		
		while(enumerationSet.hasMoreElements())
		{
			String key = (String) enumerationSet.nextElement();
			propertiesMap.put(key, properties.getProperty(key));
		}
		return propertiesMap;
	}
}
